/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn1;

/**
 *
 * @author Hiep
 */
public class Bai7 {
    static boolean nguyento(int n){
		if(n==0||n==1)return false;
		for(int i=2;i<Math.sqrt(n);i++)
			if(n%i==0) return false;
		return true;
	}
	static boolean thuannghich(int n){
		int dao=0,m=n;
		while(n>0){
			dao=dao*10+n%10;
			n=n/10;
		}
		if(dao==m) return true;
		return false;
	}
	static boolean fibo(int n){
		int f1=1;
		int f2=1;
		int tong=0;
		for(int j=1;j<=9999999;j++){
				tong=f1+f2;
				f2=f1;
				f1=tong;
			}
		int T=0;
		while(n>0){
			T=T+n%10;
			n=n/10;
		}
		if(tong==T) return true;
		return false;
		}
public static void main(String[] args){
		for(int i=10000;i<=9999999;i++)
			if(nguyento(i))
				System.out.println(" "+i);
	}

}
